package cn.jinjimi.app.player.bean;

import android.net.Uri;

import cn.jinjimi.app.player.XrkMedia;

import java.io.File;

/**
 * Created by lforxeverc on 2017/5/15.
 */

public class XrkMusicMedia implements XrkMedia {
    private final String url;
    private final File file;

    public XrkMusicMedia(String url) {
        this.url = url;
        this.file = null;
    }

    public XrkMusicMedia(File file) {
        this.file = file;
        this.url = null;
    }

    public String getUrl() {
        return url == null ? "" : url;
    }

    public Uri getUri() {
        if (file != null)
            return Uri.fromFile(file);
        else {
            return Uri.parse(url);
        }
    }
}
